package com.greenbook.dto;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import lombok.Data;


import java.time.LocalDateTime;
import java.util.List;

/**
 * 与es交互的笔记实体类
 */
@Data
public class NoteDOC {
    private String id;

    private String title;

    private String content;

    private String coverImage;

    private Integer coverHeight;

    private String noteCategory;

    private Long userId;

    private String nickname;

    private String avatar;

    private List<String> tags;

    private Integer likeCount;

    private Integer viewCount;

    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    private LocalDateTime createTime;

    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    private LocalDateTime updateTime;
}